import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
// MariaDB数据库工厂类
class MysqlFactory extends DatabaseFactory {
   public static Connection connection = null;
   public Connection getConnection(String driver, String url, String username, String password) {
       if (connection == null) {
           try {
               Class.forName(driver);
               connection = DriverManager.getConnection(url, username, password);
           } catch (ClassNotFoundException | SQLException e) {
               e.printStackTrace();
           }
       }
       return connection;
}
public CourseTableOperator createCourseOper(Connection connection){
    return new CourseTableOperator(connection);
}
public StudentTableOperator createStudentOper(Connection connection){
    return new StudentTableOperator(connection);
}
}